<include file="Public/head"/>
<style type="text/css">
    .focus-btn, .new_carousel_btn {
        width: 80px;
        border-radius: 3px;
        color: #fff;
        margin-left: 7px;
        padding: 0;
        background-color: #20ab4f;
        border: medium none;
    }

    .chenggong1 .paidan {
        padding-top: 30px;
    }

    .paidan h3 {
        font-size: 16px;
        color: #000;
        margin-bottom: 30px;
    }

    .text-input {
        background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
        border: 1px solid #c5c5c5;
        cursor: auto;
        height: 24px;
        line-height: 24px;
        margin-left: 7px;
        padding: 0;
        text-align: center;
        width: 142px;
        float:left;
    }

    #status,#city,#index_type {
        -moz-appearance: none;
        background: rgba(0, 0, 0, 0) url("{:get_style_cdnurl()}paimai/yunying/images/sanjiao.jpg") no-repeat scroll 130px 5px;
        border: 1px solid #d7d7d7;
        color: #666;
        float: left;
        font-family: "微软雅黑";
        font-size: 12px;
        height: 26px;
        line-height: 26px;
        margin: 0 10px 10px 0;
        text-align: left;
        width: 154px;
    }
    .tanShang .daiJingW {
        padding: 20px 0 0 50px;
    }

    .tanShang .daiJingW .tipmsg {
        font-size:14px;
    }
</style>
</head>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="clcwht.yhwjgl"/>
    <div class="mianR">
        <h3 class="cha">摇号文件管理</h3>
        <div class='carousel'>
            <form id="searchFrom">
                <input type="text" name="title" id="title" placeholder="请输入标题关键字" class="text-input"/>
                <select name="city" id="city" style="margin-left: 10px;">
                    <option value="">请选择城市</option>
                    <foreach name="lot_number_city_list" item="cl" key="k">
                    <option value="{$k}">{$cl}</option>
                    </foreach>
                </select>
                <select name="index_type" id="index_type">
                    <option value="">请选择指标类型</option>
                    <option value="1">个人普通</option>
                    <option value="2">个人新能源</option>
                </select>
                <select name="status" id="status">
                    <option value="">请选择状态</option>
                    <option value="1">待处理</option>
                    <option value="2">已生效</option>
                    <option value="3">解析失败</option>
                </select>
                <input type="button" value="搜索" name="focus_search" class="focus-btn"/>
            </form>
            <span style="float:right;margin-right:20px;"><input type="button" value="新增记录"
                                                                onclick="location.href = '/LotNumberFile/add'"
                                                                class="new_carousel_btn" style="width:130px"/></span>
        </div>
        <div class="yuList">
            <div class="listBox" id="listBox"></div>
        </div>
    </div>
    <!--操作弹出窗口-->
    <div class="tanShang lot_number_file_tip" style="display:none">
        <h3>操作</h3>
        <ul class="daiJingW">
            <li class="clearfix tipmsg"></li>
            <li class="clearfix">
                <input type="hidden" name="lot_id" value=""/>
                <input type="button" value="确定" class="queding" id="qd_del_lot_number_file"/>
                <input type="button" value="取消" class="quxiao"/>
            </li>
        </ul>
    </div>
    <div class="clear"></div>
    <script type="text/javascript">
        //获取url中的参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null)
                return unescape(r[2]);
            return null; //返回参数值
        }

        function del_lot_number_file(id){
            $('.tipmsg').html('确定删除此记录？');
            $("input[name='lot_id']").val(id);
            $('.lot_number_file_tip').show();
        }
        $('#qd_del_lot_number_file').click(function () {
            var lot_id = $("input[name='lot_id']").val();
            var post_data = {
                'lot_id': lot_id
            }
            $(".yunBei").css("display", "block").unbind('click')
            $(".loading").fadeIn();
            $.post('/LotNumberFile/delLotNumberFile', post_data, function (data) {
                if (data.code == 200) {
                    $('.lot_number_file_tip').hide();
                    btn_alert(data.msg);
                    setTimeout(function () {
                        window.location.reload();
                    }, 300);
                } else {
                    $(".loading").fadeOut();
                    shibai_alert(data.msg);
                }
            }, 'JSON');
        });

        get_list();
        function get_list() {
            var url = mkUrl();
            var p = getUrlParam('p');
            if (p != null) {
                var purl = "?p=" + p;
            } else {
                var purl = "?p=1";
            }
            $.get("/LotNumberFile/lotNumberFileList" + purl, url, function (data) {
                $("#listBox").html(data);
            }, "html");
        }
        function get_page(p) {
            var url = mkUrl();
            $.get("/LotNumberFile/lotNumberFileList/" + encodeURI("p/" + p), url, function (data) {
                $("#listBox").html(data);
            }, "html");
        }

        $("input[name='focus_search']").click(function () {
            get_list();
        });

        function mkUrl() {
            var url = "";
            var title = $("#title").val();
            var city = $("#city").val();
            var index_type = $("#index_type").val();
            var status = $("#status").val();
            if (title) {
                url += '&title=' + title;
            }
            if (city) {
                url += '&city=' + city;
            }
            if (index_type) {
                url += '&index_type=' + index_type;
            }
            if (status) {
                url += '&status=' + status;
            }
            ;
            return url;
        }
    </script>
    <include file="Public/foot"/>
